﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using wrzy.utll;
using System.Data.SqlClient;
using System.Data.OracleClient;

namespace wrzy
{
    public partial class Form221 : Form
    {
       // fzj fzj;
        oracleDatabase oracle;
        sqlServer sql;
        OracleDataReader reader;
        SqlDataReader sqlReader;
        public Form221()
        {
            InitializeComponent();
           // fzj = new fzj();
            sql = new sqlServer();
            oracle = new oracleDatabase();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            sqlReader = sql.ExecuteReader("select sam1,sam2 from [zyprocStatus]");
            sqlReader.Read();
            label2.Text = sqlReader.GetValue(0).ToString();
            label3.Text = sqlReader.GetValue(1).ToString();
            oracle.ExecuteSql("update stamtus1 set sample=" + sqlReader.GetValue(0));
            oracle.ExecuteSql("update stamtus2 set sample=" + sqlReader.GetValue(1));
            sqlReader.Close();
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            /*
            fzj.SetDeviceDO3(1);
            Thread.Sleep(2000);
            fzj.SetDeviceDO3(0);
             */
        }
    }
}
